package com.swyc.osschat.Test.designMode.interpreter.vo;

import com.swyc.osschat.Test.designMode.interpreter.strategy.VariableExpression;

import java.util.HashMap;
import java.util.Map;

/**
 * @description 环境角色：
 * @Author: z156940l@outlook.com
 * @className Context
 * @Date: 2022/6/27 15:29
 */
public class Context {
    //存储变量及对应的值
    private Map<VariableExpression,Integer> map = new HashMap<>();

    //添加变量
    public void addVar(VariableExpression variable, Integer value){
        map.put(variable,value);
    }

    //根据变量获取对应的值
    public int getValue(VariableExpression variable){
        return map.get(variable);
    }
}
